package com.heyue.demo.Singleton;

/**
 * @author fenghe
 * @date 2022/2/12 12:50
 */
public class Lazy {
    /**懒汉式*/
    private static Lazy instance;

    // 私有化构造方法
    private Lazy() {

    }

    public static synchronized Lazy getInstance() {
        if(instance == null) {
            instance = new Lazy();
        }
        return instance;
    }
}
